#ifndef USERMANAGERMENU_H
#define USERMANAGERMENU_H

#include <QWidget>
#include <QSqlQueryModel>
#include <QSqlQuery>
#include <QTableView>
#include <QMessageBox>
#include <QRadioButton>
#include <QSqlError>
#include <QEvent>
#include <QMouseEvent>
#include <QDateTime>

#include "User.h"

namespace Ui {
class UserManagerMenu;
}

class UserManagerMenu : public QWidget
{
    Q_OBJECT

public:
    explicit UserManagerMenu(QWidget *parent = nullptr);
    explicit UserManagerMenu(User userInfo, QWidget *parent = nullptr);
    ~UserManagerMenu();

    void initMenu(void);

protected:
    void mouseReleaseEvent(QMouseEvent *event) override;

private slots:
    void m_on_tv_userInfoList_clicked(const QModelIndex& index);
    void m_on_btn_add_clicked(void);
    void m_on_btn_delete_clicked(void);
    void m_on_btn_update_clicked(void);
    void m_on_btn_find_clicked(void);
    void m_on_tbtn_permissionBitsChose_clicked(void);

private:
    Ui::UserManagerMenu *ui;

    QSqlQueryModel* m_sqlQueryModel;

    bool m_tv_userInfoListSelectflag;
    int m_tv_userInfoListSelectUserId;

    User m_userInfo;
};

#endif // USERMANAGERMENU_H
